<!DOCTYPE html>
<html lang="en" layout:decorator="common/contentLayout"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">

<!--页面内容 继承自common/contentLayout.html-->
<div layout:fragment="content">
    <fieldset class="layui-elem-field">
        <legend th:text=" '[ ' +${topicName} + ' ] 消息主题缩容'"></legend>
        <div class="layui-field-box">
            <button class="layui-btn" id="refresh">刷新内容</button>
            <input type="hidden" id="topicIdV" th:value="${topicId}">
            <table id="queueRemoveTable" class="layui-table" lay-filter="queueRemoveTable">

            </table>
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>操作说明：</legend>
            </fieldset>
            <p >1. 队列移除前，需要将队列设为只读，否则无法移除</p>
            <p >2. 队列移除前，需要将队列内的数据全部消费，否则队列无法移除</p>
            <p >3. 如果想强制移除队列，且删除topic，可以联系管理员</p>
            <br />
            <p style="color: red;">NOTE！ 若缩容后所有队列都在1个节点上，该缩容行为会被阻止</p>
        </div>
    </fieldset>

</div>

<div layout:fragment="end-load-files">
    <script th:src="@{/js/queueRemove.js}"></script>

    <script type="text/html" id="ctrlBar">
        {{# if (d.queueReadOnly != 2) { }}
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="readOnly">只读</a>
        {{# } }}
        {{# if (d.isBestRemove != 1) { }}
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="remove">移除</a>
        {{# } else { }}
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a>
        {{# } }}
    </script>

    <script type="text/html" id="queueReadOnlyTpl">
        {{# if (d.queueReadOnly == 1) { }}
            可读可写
        {{# } else if(d.queueReadOnly == 2){ }}
            只读
        {{# }else{ }}
            不可读不可写
        {{# } }}
    </script>

    <script type="text/html" id="readStatusTpl">
        {{# if (d.readStatus == 1) { }}
        可读可写
        {{# } else if(d.readStatus == 2){ }}
        只读
        {{# }else{ }}
        不可读不可写
        {{# } }}
    </script>

    <script type="text/html" id="dbReadOnlyTpl">
        {{# if (d.dbReadOnly == 1) { }}
        可读可写
        {{# } else if(d.dbReadOnly == 2){ }}
        只读
        {{# }else{ }}
        不可读不可写
        {{# } }}
    </script>

    <script type="text/html" id="bestRemoveTpl">
        {{# if (d.isBestRemove != 1) { }}
        否
        {{# } else { }}
        是
        {{# } }}
    </script>

    <style type="text/css">
        .warn1 {
            color: red;
            font-size: large;
            font-weight: bold;
        }
    </style>
</div>
</html>
